package com.softa.service.system;

import java.util.List;
import java.util.Set;

import com.github.pagehelper.PageInfo;
import com.softa.bean.DataGridModel;
import com.softa.dao.dto.SysUserDTO;
import com.softa.dao.model.SysResource;
import com.softa.dao.model.SysUser;
import com.softa.vo.DataGridRequest;
import com.softa.vo.QueryRequest;

/**
 * 
* @ClassName: UserService
* @Description: TODO
* @author yangl
* @date 2015-6-3 下午1:10:04
*
 */
 public interface UserService {

    /**
     * 创建用户
     * @param user
     */
	 String createUser(SysUser user);

	 String updateUser(SysUserDTO sysUserDTO);

     void deleteUser(Long userId);

    /**
     * 修改密码
     * @param userId
     * @param newPassword
     */
     void changePassword(Long userId, String newPassword);


     SysUser findOne(Long userId);

    List<SysUser> findAll();

    /**
     * 根据用户名查找用户
     * @param username
     * @return
     */
    SysUser findByUsername(String username);

    /**
     * 根据用户名查找其角色
     * @param username
     * @return
     */
     Set<String> findRoles(String username);

    /**
     * 根据用户名查找其权限
     * @param username
     * @return
     */
     Set<String> findPermissions(String username);

    PageInfo<SysUserDTO> queryUserByParam(DataGridRequest request, final QueryRequest queryRequest);

    Long queryUserTotalByParam(DataGridModel dataGrid);
	 
	 List<SysResource> findResourceList(String username);

    SysUser findAdminUser();

    Integer checkusername(SysUser user);

}
